package day3;

import java.text.DecimalFormat;
import java.util.Scanner;

public class Homework {
    public static void main(String[] args) {
        test3();
    }

    private static void test() {
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入消费金额:");
        double money=sc.nextDouble();
        double after=money*0.8;
        if (after>1000){
            System.out.println("恭喜你获得200元代金券一张！");
            System.out.println("您需要支付的金额为:"+(after-200));
        }else {
            System.out.println("您需要支付的金额为:"+after);
        }
    }

    public static void test1(){
        double hight=56.7;
        double day=5;
        double dark=3.5;
        double total=0;
        int i;
        int tianshu=0;
        while (total<56.7){
            if (hight-total>=5){
                total+=day-dark;
                tianshu=tianshu+1;
            }
        }
        System.out.println("爬出所需要的天数为："+(tianshu+1));
    }

    public static void test2(){
        double money=1;
        double totalmoney=0;
        int day=0;
        do {
            totalmoney+=money;
            money=money*1.5;
            day=day+1;
        }while(day<30);
        DecimalFormat df=new DecimalFormat("#.##");
        String total=df.format(totalmoney);
        System.out.println("第"+day+"天时一共存了"+total+"元");
    }

    public static void test3(){
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入一个正整数:");
        int num=sc.nextInt();
        System.out.print(num+"=");
        boolean xinghao=true;
        int i=2;
        while (i<=num){
            if (num%i==0){
                if (!xinghao){
                    System.out.print("*");
                }
                System.out.print(i);
                num=num/i;
                xinghao=false;
            }else i++;
        }

    }
}
